<cfsilent>
	<cfinvoke component="components.NamedGateway" method="getNamedList" returnvariable="queryNamed" />
	<cfparam name="form.isFormSubmitted" type="boolean" default="false" />
	<cfif isFormSubmitted>
		<cfloop from="1" index="counter" to="#listLen(form.namedIDSequence)#">
			<cfquery name="insertNamed" datasource="tidtool">
				UPDATE
					Named
				SET
					MonsterName = <cfqueryparam cfsqltype="cf_sql_varchar" value="#listGetAt(form.MonsterNameSequence, counter)#" />,
					Type = <cfqueryparam cfsqltype="cf_sql_varchar" value="#listGetAt(form.TypeSequence, counter)#" />,
					Step = <cfqueryparam cfsqltype="cf_sql_varchar" value="#listGetAt(form.StepSequence, counter)#" />
				WHERE
					ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#listGetAt(form.namedIDSequence, counter)#" />
			</cfquery>
		</cfloop>
	</cfif>
</cfsilent>
<cfoutput>
	<form name="" action="" method="post">
		<table>
			<tr>
				<th colspan="4">
					Liste aller Named die in der Datenbank gespeichert sind.
				</th>
			</tr>
			<tr>
				<th>ID</th>
				<th>Name</th>
				<th>Typ/Art</th>
				<th>Step (von 35)</th>
			</tr>
			<cfloop query="queryNamed">
				<tr>
					<td>
						<input type="hidden" name="namedIDSequence" value="#queryNamed.ID#" />
						#queryNamed.ID#
					</td>
					<td>
						<input type="text" name="MonsterNameSequence" value="#queryNamed.MonsterName#" />
					</td>
					<td>
						<input type="text" name="TypeSequence" value="#queryNamed.Type#" />
					</td>
					<td>
						<input type="text" name="StepSequence" value="#queryNamed.Step#" />
					</td>
				</tr>
			</cfloop>
			<tr>
				<td colspan="3"></td>
				<td>
					<input type="hidden" name="isFormSubmitted" value="true" />
					<input type="submit" name="submit" value="speichern" />
				</td>
			</tr>
		</table>
	</form>
</cfoutput>